package com.itheima.d7_commons_io;


import org.apache.commons.io.FileUtils;

import java.io.File;

/**
 * 目标：使用CommonsIO框架进行IO相关的操作。
 *
 * FileUtils
 */
public class CommonsIOTest1 {
    public static void main(String[] args) throws Exception {
        //public static void copyFile(File srcFile, File destFile)
        File srcFile = new File("day09file-io-app/img1/img1.jpeg");
        File destFile = new File("day10io-app2/file2/img1.jpeg");
        FileUtils.copyFile(srcFile,destFile);

        //public static void copyDirectory(File srcDir, File destDir)
        File srcDir = new File("day09file-io-app/img1");
        File destDir = new File("day10io-app2/file2");
//        File destDir = new File("day10io-app2/file3");
        FileUtils.copyDirectory(srcDir,destDir);

        //public static void deleteDirectory(File directory)
        File dir = new File("day10io-app2/file3");
        FileUtils.deleteDirectory(dir);

    }
}
